Subtyping with Singleton Types
نویسنده
چکیده
We give syntax and a PER-model semantics for a typed-calculus with subtypes and singleton types. The calculus may be seen as a minimal calculus of sub-typing with a simple form of dependent types. The aim is to study singleton types and to take a canny step towards more complex dependent subtyping systems. Single-ton types have applications in the use of type systems for speciication and program extraction: given a program P we can form the very tight speciication fP g which is met uniquely by P. Singletons integrate abbreviational deenitions into a type system: the hypothesis x : fM g asserts x = M. The addition of singleton types is a non-conservative extension of familiar subtyping theories. In our system, more terms are typable and previously typable terms have more (non-dependent) types. 1 Introducing Singletons and Subtyping Type systems for current programming languages provide only coarse distinctions amongst data values: Real, Bool, String, etc. Constructive type theories for program speciication can provide very ne distinctions such as fx 2 Nat j Prime(x)g, but often terms contain non-computational parts, or else type-checking is undecidable. We want to study type systems in between where terms do not contain unnecessary codes and, ideally, type-checking is decidable. When types express requirements for data values more accurately, it can help to eliminate more run-time errors and to increase conndence in program transformations which are type-preserving. Singleton types express the most stringent requirement imaginable. Suppose fac stands for the expression: f: x: if x = 0 then 1 else x (f(x ? 1)) Then ffacg is a speciication of the factorial function, and fac : ffacg says that fac satisses the speciication ffacg. This is an instance of the principal assertion for singleton types, M : fMg. But syntactic identity is too stringent; we can write the
منابع مشابه
Subtyping À La Church
Type theories with higher-order subtyping or singleton types are examples of systems where the computational behavior of variables is determined by type information in the context. A complication for these systems is that bounds declared in the context do not interact well with the logical relation proof of completeness or termination. This paper proposes a simple modification to the type synta...
متن کاملRelating Church-Style and Curry-Style Subtyping
Type theories with higher-order subtyping or singleton types are examples of systems where computation rules for variables are affected by type information in the context. A complication for these systems is that bounds declared in the context do not interact well with the logical relation proof of completeness or termination. This paper proposes a natural modification to the type syntax for Fω...
متن کاملSystem ST β - reduction and completeness Christophe
We prove that system ST (introduced in a previous work) enjoys subject reduction and is complete for realizability semantics. As far as the author knows, this is the only type system enjoying the second property. System ST is a very expressive type system, whose principle is to use two kinds of formulae: types (formulae with algorithmic content) and propositions (formulae without algorithmic co...
متن کاملSubtyping Constrained Types ( Draft ) Valery Trifonov
Constrained type systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on constrained types. We establish a full type abstraction property that equates an operational notion of subtyping with a semantic notion based on regular trees. The decidability of this notion of subtyping is open; we present a dec...
متن کاملSubtyping Constrained Types
A constrained type is a type that comes with a set of subtyping constraints on variables occurring in the type. Constrained type inference systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on polymorphic constrained types of a general form that allows recursive constraints and multiple bounds on typ...
متن کامل